<div ng-controller="ReviewController">
    <div class="search mt15 f12 clearfix">
       <div style="width:113px" class="fl">
            <div ui-combobox data="search.fieldList" text-field="text" value-field="value" ng-model="search.queryKey"></div>
        </div>
        <input type="text" name="" class="input-text mr5 fl" value="" ng-model="search.keyword"
               ng-enter="getSearchData()" style="width: 348px;">
        <button class="btn" ng-click="getSearchData()">搜索</button>
    </div>
    <div style="position: relative; padding-bottom: 10px;">
        <table width="100%" class="mt10">
            <tbody>
            <tr>
                <td align="left" width="70" class="form-cell pt16" valign="top">审核状态：</td>
                <td class="pt16">
                    <div style="display:block;">
                        <div class="tips-list fl12 clearfix" align="left" style="margin-left: 0px; margin-top: 2px;">
                            <div class="checkbox"
                                 ng-repeat="item in reviewShenheList">
                                <input type="checkbox" value="0" id="review{{item.shenhe}}" ng-model="item.selected"
                                       ng-change="updataReviewPassCheck(item)">
                                <label for="review{{item.shenhe}}">{{item.Text}}</label>
                            </div>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td align="left" width="70" class="form-cell pt16" valign="top">禁用状态：</td>
                <td class="pt16">
                    <div style="display:block;">
                        <div class="tips-list fl12 clearfix" align="left" style="margin-left: 0px; margin-top: 2px;">
                            <div class="checkbox ">
                                <input type="checkbox" id="rbt_disable_true" value="1" ng-model="disabledProxy.disableTrue" ng-change="updateDisabledCheck(1)">
                                <label for="rbt_disable_true">已禁用</label>
                            </div>
                            <div class="checkbox ">
                                <input type="checkbox" id="rbt_disable_false" value="0" ng-model="disabledProxy.disableFalse" ng-change="updateDisabledCheck(0)">
                                <label for="rbt_disable_false">未禁用</label>
                            </div>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td align="left" width="70" class="form-cell  pt16" valign="top">审核时间：</td>
                <td class="pt12">
                    <div class="fl clearfix ng-scope">
                        <input type="text" class="input-text input-data fl ng-pristine ng-valid ng-touched" readonly=""
                               ui-date="" format="yyyy-MM-dd" id="start_date" max-date="#F{$dp.$D(\'end_date'\)}" ng-model="filter.startDate">
                        <span class="fl lh30">&nbsp;&nbsp;-&nbsp;&nbsp;</span>
                        <input type="text" class="input-text input-data fl ng-pristine ng-untouched ng-valid"
                               readonly="" ui-date="" format="yyyy-MM-dd" id="end_date" min-date="#F{$dp.$D(\'start_date'\)}" ng-model="filter.endDate">
                        <a href="javascript: void(0)" class="btn fl mlr5" ng-click="getFilterData()">查询</a>
                        <a href="javascript: void(0)" class="btn btn-gray fl" ng-click="filter.clearFilter()">撤销筛选</a>
                    </div>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <div class="grid-header mt5" style="position: relative; margin-bottom: 10px;">
        <div class="clearfix" style="padding-bottom:4px;">
            <span class="fl f14 lh30 text-indent">中介机构列表</span>

            <div class="fr btn-group">
                <a href="javascript: void(0)" class="btn btn-yellow permission p-50030607-99"
                   ng-click="exportData($event)">导出</a>
            </div>
        </div>
        <div class="tab-bottom-line"></div>
    </div>
    <div class="table-wrap">
        <table width="100%">
            <thead>
            <tr class="thead ta-l">
                <th height="34" width="50">
                    <div class="text-center">
                        <label for="cb1">序号</label>
                    </div>
                </th>
                <th width="130">机构公司名称</th>
                <th width="60">用户名</th>
                <th width="70">所属城市</th>
                <th width="100">负责人信息</th>
                <th width="60">审核状态</th>
                <th width="60">禁用状态</th>
                <th width="110">门店信息</th>
                <th width="140">审核信息</th>
                <th width="130">操作</th>
            </tr>
            </thead>
            </tbody>
            <tbody ng-if="!loading && list && list.length>0">
            <tr ng-repeat="item in list"
                ng-mouseover="item.hover = true"
                ng-mouseleave="item.hover = false">
                <td height="60">
                    <div class="text-center"><label for="cb1">{{filter.pageSize*(pageIndex - 1)+$index+1}}</label></div>
                </td>
                <td>{{item.agency_name}}</td>
                <td>{{item.user_code}}</td>
                <td>{{item.city_name}}</td>
                <td>
                    <span class="fl" style="width: 100%;">{{item.person_in_charge}}</span>
                    <span class="fl" style="width: 100%;">{{item.mobile_tel}}</span>
                </td>
                <td>{{item.shenhe_status}}</td>
                <td>{{item.isdisabled}}</td>
                <td>
                    <p>门店数：<a href="javascript:;" class="c-orange"
                              ui-dialog="查看门店"
                              ui-dialog-data="shopData"
                              ui-dialog-ok=""
                              ui-dialog-cache="false"
                              ui-dialog-show="getShopData(item,$dialog,$dialogScope)"
                              ui-dialog-url="inc/dialog/intermediary_organ_show_shop.html">{{item.agency_store_num}}</a>
                    </p>

                    <p>未审核经纪人：<a href="javascript:;" class="c-orange"
                                 ui-dialog="审核机构经纪人"
                                 ui-dialog-data="shopData"
                                 ui-dialog-ok=""
                                 ui-dialog-cache="false"
                                 ui-dialog-show="getAgentData(item,$dialog,$dialogScope)"
                                 ui-dialog-url="inc/dialog/intermediary_organ_review_agent.html">{{item.broker_num}}
                    </a>
                    </p>

                    <p>
                        经纪人数：<a href="/page/intermediary_organ/broker.shtml#/agent_broker/audited/{{item.b_agenciesId}}" class="c-orange">
                        {{item.agency_store_regbroker_num}}
                    </a>
                    </p>

                </td>
                <td>
                    <span class="fl" style="width: 100%;">{{item.audit_username}}</span>
                    <span class="fl" style="width: 100%;">{{item.auditon}}</span>
                </td>
                <td>
                    <p class="ng-hide" ng-show="item.hover">
                        <a href="javascript:;" class="fl mt5 mr10 c-orange permission p-50030601-01"
                           ng-show="!(item.shenhe_status == '未通过' || item.isdisabled == '已禁用' || item.agency_store_regbroker_num == '0')"
                           ui-dialog="审核机构经纪人"
                           ui-dialog-ok=""
                           ui-dialog-cache="false"
                           ui-dialog-show="getAgentData(item,$dialog,$dialogScope)"
                           ui-dialog-url="inc/dialog/intermediary_organ_review_agent.html">审核机构经纪人
                        </a>
                        <a href="javascript:void(0)" title="审核通过"
                           ng-show="!(item.shenhe_status == '已通过')"
                           ng-click="passReview(item)"
                           class="fl mt5 mr10 c-orange permission p-50030607-01">审核通过</a>
                        <a href="javascript:void(0)" title="禁用" ng-if="item.isdisabled == '未禁用'"
                           ng-click="setDisable(item)"
                           class="fl mt5 c-orange permission p-50030607-02">禁用</a>
                        <a href="javascript:void(0)" title="启用" ng-if="item.isdisabled == '已禁用'"
                           ng-click="setEnable(item)"
                           class="fl mt5 c-orange permission p-50030607-02">启用</a>
                    </p>

                </td>
            </tr>

            </tbody>
        </table>
        <div class="tab_loading" ng-if="loading"><span>加载中...</span></div>
        <div class="no-data" ng-if="!loading && (!list || list.length==0)"><span>暂无数据</span></div>
    </div>
    <div ui-pagination page-index="pageIndex" page-size="filter.pageSize" total="total"
         changed="getDataPage($pageIndex)"></div>
</div>